﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace NHADAT.Controllers
{
    public class AccountController : Controller
    {
        //
        // GET: /Account/
        [Authorize]
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Login()
        {
            return View();
        }



        public ActionResult SignOut()
        {
            if (User.Identity.IsAuthenticated)
                ClearUserSession();
            return RedirectToAction("Index", "Home");
        }

        private void ClearUserSession()
        {
            FormsAuthentication.SignOut();
            Session.Abandon();
            Session.Clear();
        }

    }
}
